<!DOCTYPE html>
<html  xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
	<script type="text/javascript" src="../static/jquery-easyui-1.5.5.3/jquery.min.js"></script>
	<link rel="stylesheet" href="../webjars/bootstrap/3.3.7-1/css/bootstrap.css">
	<link rel="stylesheet" href="../static/jquery-easyui-1.5.5.3/themes/material-teal/easyui.css" />
	<link rel="stylesheet" href="../static/jquery-easyui-1.5.5.3/themes/icon.css" />
	<link rel="stylesheet" href="../static/css/customForm.css">
	<script type="text/javascript" src="../static/jquery-easyui-1.5.5.3/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="../static/jquery-easyui-1.5.5.3/locale/easyui-lang-zh_CN.js"></script>
	<script type="text/javascript" src="../webjars/bootstrap/3.3.7-1/js/bootstrap.js"></script>
	<script type="text/javascript">
		function hs(id,bk_id){
			var j=confirm("确定还书吗？");
			if(j){
				$.ajax({
				  type: "post", 
				  url: "hs", 
				  data: {id: id,bk_id:bk_id}, 
				  success: function (data) { 
				      alert(data); 
				   window.location.reload();
				    	 
				} 
			});
		}else{
			return false;
		}
	}
	</script>
</head>
<body>
	<table style="width: 100%;text-align: center;"  class="table table-striped">
	<h4 style="color: black;text-align: center;"><b>我的已借书籍表</b></h4>
		<tr style="text-align: center;">
			<th style="text-align: center;">读者ID</th>
			<th style="text-align: center;">姓名</th>
			<th style="text-align: center;">联系电话</th>
			<th style="text-align: center;">联系方式</th>
			<th style="text-align: center;">借书日期</th>
			<th style="text-align: center;">还书日期</th>
			<th style="text-align: center;">书名</th>
			<th style="text-align: center;">操作</th>
			
		</tr>
		<tr th:each="r:${records}">
			<td th:text="${r.reader}"></td>
			<td th:text="${r.borrowedName}"></td>
			<td th:text="${r.contactWay}"></td>
			<td th:text="${r.contactPhone}"></td>
			<td th:text="${r.date}"></td>
			<td th:text="${r.endDate}"></td>
			<td th:text="${r.book}"></td>
			<td>
				<a href="#" th:onclick="'javascript:hs(\''+${r.id}+'\',\''+${r.bk.id}+'\')'">还书</a>
			</td>
	</tr>
	</table>
</body>
</html>